package com.situ.onlinebookstore.back.controller;

import com.situ.onlinebookstore.common.util.VerCodeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Controller
public class VerCodeController {
    @RequestMapping("/verCode")
    public void verCode(HttpServletResponse response, HttpSession session){
        //生成验证码
        String verCode = VerCodeUtil.createVerCode(120,30,4,response);
        //保存到Session中
        session.setAttribute("verCode",verCode);
    }
}
